<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="Keywords" content="网站关键词">
    <meta name="Description" content="网站介绍">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <link rel="stylesheet" href="./css/reg.css">

    <!--    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>-->
    <!--    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>-->
    <script src="/web/js/vue.min.js"></script>
    <script src="/web/js/axios.js"></script>
    <script src="/web/js/http.js"></script>
    <link rel="stylesheet" href="/web/css/element.css">
    <script src="/web/js/element.js"></script>

</head>
<body>
    <div id="ajax-hook"></div>
    <div id="app" class="wrap" >
        <div class="wpn">
            <div class="form-data pos">
                <a href=""><img src="./img/logo.png" class="head-logo"></a>
                <!--<p class="tel-warn hide"><i class="icon-warn"></i></p>-->
                <form>

                    <p class="p-input pos">
                        <label for="tel"  >用户名</label>
                        <input type="text" id="tel" v-model="user.name" autocomplete="off" >
                        <span class="tel-warn tel-err hide"><em></em><i class="icon-warn"></i></span>
                    </p>
                    <p class="p-input pos">
                        <label for="tel">手机号</label>
                        <input type="number" id="tel" v-model="user.phone" autocomplete="off">
                        <span class="tel-warn tel-err hide"><em></em><i class="icon-warn"></i></span>
                    </p>

                    <p class="p-input pos">
                        <label for="tel">密码</label>
                        <input type="password" id="tel" v-model="user.password" autocomplete="off">
                        <span class="tel-warn tel-err hide"><em></em><i class="icon-warn"></i></span>
                    </p>
<!--                    <p class="p-input pos" id="sendcode">-->
<!--                        <label for="veri-code">输入验证码</label>-->
<!--                        <input type="number" id="veri-code">-->
<!--                        <a href="javascript:;" class="send">发送验证码</a>-->
<!--                        <span class="time hide"><em>120</em>s</span>-->
<!--                        <span class="error hide"><em></em><i class="icon-warn" style="margin-left: 5px"></i></span>-->
<!--                    </p>-->
<!--                    <p class="p-input pos hide">-->
<!--                        <label for="passport">输入密码</label>-->
<!--                        <input type="password" style="display: none"/>-->
<!--                        <input type="password" id="passport">-->
<!--                        <span class="tel-warn pwd-err hide"><em></em><i class="icon-warn" style="margin-left: 5px"></i></span>-->
<!--                    </p>-->
<!--                    <p class="p-input pos hide">-->
<!--                        <label for="passport2">确认密码</label>-->
<!--                        <input type="password" style="position:absolute;top:-998px"/>-->
<!--                        <input type="password" id="passport2">-->
                    <!--                        <span class="tel-warn confirmpwd-err hide"><em></em><i class="icon-warn" style="margin-left: 5px"></i></span>-->
                    <!--                    </p>-->
                </form>
                <button class="lang-btn" @click="registerClick()">注册</button>
                <div class="bottom-info">已有账号，<a href="./index.html">马上登录</a></div>
            </div>
        </div>
    </div>
    <script src="../js/jquery.js"></script>
    <script src="../js/agree.js"></script>
    <!--    <script src="../js/http.js"></script>-->
    <script src="../js/reg.js"></script>

</body>

<script type="module">
    // import {postRequest} from "../js/http.js";

    var app = new Vue({
        el: '#app',
        data: {
            user: {
                name: '',
                password:'',
                phone:''
            },

        },
        methods:{
            registerClick(){
                postRequest("shopping_boot/App/sysUser/registerUser",this.user).then(res=>{
                    console.log(res);
                    if (res.code===200) {
                        alert("注册成功")
                        location.href="./index.html"
                    }else{
                        // Message.error({message: data.data.msg});
                        alert("注册失败："+res.msg)
                    }
                })
            }
        }
    })
</script>
</html>